package com.zjj.day2.Test6;

/**
 * @author zhoujunjie
 * @desc TODO
 * @date 2025/4/20
 */
import java.util.ArrayList;
import java.util.List;

class Order {
    private String orderId;
    private List<Goods> goodsList;

    public Order(String orderId) {
        this.orderId = orderId;
        this.goodsList = new ArrayList<>();
    }

    public void addGoods(Goods goods) {
        goodsList.add(goods);
    }

    public void viewGoodsDetails() {
        System.out.println("订单号: " + orderId);
        System.out.println("商品详情信息:");
        for (Goods goods : goodsList) {
            System.out.println(goods);
        }
    }

    public String getOrderId() {
        return orderId;
    }
}